<extend name="Base/common"/>
<block name="Content">
	<div class="am-cf am-padding-top">
        <div class="am-fl am-cf">
            <i class="am-icon-pencil-square-o"></i>
            <strong class="am-text-primary am-text-lg">
               <notempty name="siteModel">
                    编辑<else/>新增
                </notempty>站点
            </strong>
        </div><hr data-am-widget="divider" class="am-divider am-divider-default" />
    </div>
    <div class="am-tabs" data-am-tabs>
        <ul class="am-tabs-nav am-nav am-nav-tabs">
            <li>
                <a href="#tab2">站点信息</a>
            </li>
        </ul>
        <div class="am-tabs-bd">
            <div class="am-tab-panel am-fade" id="tab2">
                <form class="am-form" method="post" action="{:U('saveAction')}">
                    <div class="am-g am-margin-top">
                        <div class="am-u-sm-4 am-u-md-2 am-text-right">
                            排序号
                        </div>
                        <div class="am-u-sm-8 am-u-md-4 am-u-end col-end">
                            <input type="number" class="am-input-sm" min="1" step="1"
                            	name="sort_no" value="{$siteModel['sort_no']}">
                        </div>
                        <div class="am-hide-sm-only am-u-md-6">
                            *值越小，显示位置越靠前
                        </div>
                    </div>
                    <div class="am-g am-margin-top">
                        <div class="am-u-sm-4 am-u-md-2 am-text-right">
                            站点名称
                        </div>
                        <div class="am-u-sm-8 am-u-md-4">
                            <input type="text" class="am-input-sm" name="site_name" value="{$siteModel['site_name']}" required/>
                            <input type="hidden" name="province" id="province" value="{$siteModel['province']}" />
                            <input type="hidden" name="city" id="city" value="{$siteModel['city']}" />
                            <input type="hidden" name="district" id="district" value="{$siteModel['district']}" />
                            <input type="hidden" name="latitude" id="latitude" value="{$siteModel['latitude']|default='39.98752'}" />
                            <input type="hidden" name="longitude" id="longitude" value="{$siteModel['longitude']|default='116.41945'}" />
                        </div>
                        <div class="am-hide-sm-only am-u-md-6">
                            *必填，不可重复
                        </div>
                    </div>
                    <div class="am-g am-margin-top">
                        <div class="am-u-sm-4 am-u-md-2 am-text-right">
                            站点位置
                        </div>
                        <div class="am-u-sm-8 am-u-md-4">
                        	<div class="am-input-group am-input-group-sm">
			                    <input type="text" class="am-form-field am-input-sm" 
			                    	placeholder="站点地址" name="address" id='address' value="{$siteModel['address']}"/>
			                    <span class="am-input-group-btn">
			                        <button class="am-btn am-btn-default" type="button" onclick="codeAddress()">
			                            搜索
			                        </button>
			                    </span>
			                </div>
                        </div>
                        <div class="am-hide-sm-only am-u-md-6">
                        </div>
                    </div>
                    <div class="am-g am-margin-top">
                        <div class="am-u-sm-4 am-u-md-2 am-text-right">
                        </div>
                        <div class="am-u-sm-8 am-u-md-8">
                        	<div name="container" id="container" style="height:300px"></div>
                        </div>
                        <div class="am-hide-sm-only am-u-md-2">
                        </div>
                    </div>
                    <div class="am-margin">
                        <button type="submit" class="am-btn am-btn-success am-btn-xs ajax-post" target-form="am-form">
                            提交保存
                        </button>
                        <button type="button" class="am-btn am-btn-secondary am-btn-xs" onclick="javascript:history.back(-1);return false;">
                            返回列表
                        </button>
                        <input type="hidden" name="site_id" value="{$siteModel['site_id']}"/>
                    </div>
                </form>
            </div>
        </div>
    </div>
    </div>
</block>

<block name="script">

<script src="__PUBLIC__/Common/js/map.js" type="text/javascript"></script>

<script type="text/javascript">
	   
window.onload = loadScript;
</script>

</block>